home *** CD-ROM | disk | FTP | other *** search
- /** $VER: GetXRef.ged 0.9 (6. Apr. '94)
- **
- ** Written by Fin Schuppenhauer
- **
- ** Display the hypertext Autodoc page for the word currently under
- ** the cursor.
- ** Based on the script "getxref.ttx" (V2.0) by David N. Junod.
- **
- ** ***
- **
- ** Zeigt die Hypertext-Autodoc-Seite für das Wort unter dem Cursor
- ** an.
- ** Dieses Skript basiert auf dem Skript "getxref.ttx" (V2.0) von
- ** David N. Junod.
- **
- **
- ** My address:
- **
- ** Fin Schuppenhauer
- ** Brausspark 10
- ** D-20537 Hamburg
- ** (Germany)
- **
- ** E-Mail: schuppen@rzdspc2.informatik.uni-hamburg.de
- **
- ** This script is FREEWARE.
- **
- ** Thanks to:
- ** Dietmar Eilert for his GoldED
- ** David N. Junod
- **/
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
-
-
- 'QUERY CAT'
- isGerman = (result = "deutsch")
-
- /* amigaguide.library öffnen (falls dies noch nicht geschehen ist): */
- if ~show('L','amigaguide.library') then
- if ~addlib('amigaguide.library',0,-30) then do
- if isGerman then
- 'REQUEST BODY="Keine amigaguide.library vorhanden!" BUTTON=Abbrechen'
- else
- 'REQUEST BODY="amigaguide.library not available!" BUTTON=Cancel'
- 'UNLOCK'
- EXIT
- end
-
- /* Wort unter dem Cursor ermitteln: */
- 'QUERY WORD VAR WORT'
-
- if isGerman then
- 'REQUEST BODY="Informationen laden für:" OLD='wort' STRING VAR=WORT'
- else
- 'REQUEST BODY="Loading information for:" OLD='wort' STRING VAR=WORT'
- if rc ~= 0 then do
- 'UNLOCK'
- EXIT
- end
-
- /* Autodoc cross-reference table laden, wenn noch nicht vorhanden: */
- line = GetXRef("OpenWindow()")
- if line = 10 then do
- if isGerman then
- 'REQUEST STATUS="Lade Cross-Reference Datei ..."'
- else
- 'REQUEST STATUS="Loading cross-reference file ..."'
- LoadXRef(autodocs.xref)
- end
-
- /* Gibt es das Wort in der cross-reference-table? */
- function = wort
- xref = 0
- line = GetXRef(function)
- if line = 10 then do
- /* Klammern an den Namen anhängen: */
- function = wort || "()"
-
- /* Nochmal versuchen: */
- line = GetXRef(function)
- if line = 10 then do
- function = wort
- end
- else do
- xref = 1
- end
- end
- else
- xref = 1
-
- if isGerman then
- 'REQUEST STATUS="Lade ' || function || ' ..."'
- else
- 'REQUEST STATUS="Loading '||function||' ..."'
-
- /* Haben wir schon ein Autodoc-Fenster geöffnet? */
- if ~show('P','AUTODOCS') then do
- if xref = 0 then
- cmd = "run >NIL: AmigaGuide " || function || " portname AUTODOCS pubscreen GOLDED.1 requester"
- else
- cmd = "run >NIL: AmigaGuide document " || function || " portname AUTODOCS pubscreen GOLDED.1 requester"
-
- ADDRESS COMMAND cmd
- end
- else do
- link = "Link"
-
- if xref = 0 then
- cmd = link || " " || function || "/main"
- else
- cmd = link || " " || function
-
- OPTIONS FAILAT 21
- ADDRESS AUTODOCS cmd
- if rc = 20 then
- if isGerman then
- 'REQUEST BODY="Keine Information für|'''function''' vorhanden." BUTTON=Ok'
- else
- 'REQUEST BODY="No information for|'''function''' available." BUTTON=Ok'
- else
- ADDRESS AUTODOCS "windowtofront"
- end
-
-
- /* ---------------------------- END OF YOUR CODE --------------------- */
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-
-
-